<template>
  <div class="collectidone">
    <div id="shoucang0" class="fa fa-user fa-lg">收藏人群信息</div>
    <div id="textbody">
      <div id="textimg" v-for='(val,key) in peopleinf'>
        <img :src="getcollectonepic(peopleinf[key].healthPic)" alt/>
        <router-link
          :to="'/index/article/' + peopleinf[key].peopleId"
          id="texttext"
        >{{peopleinf[key].healthTitle}}</router-link>
      </div>
      <hr>
      <p id="textbottom">暂无别的收藏，已最底部！！！</p>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      peopleinf: [],
    };
  },
  created() {
    this.$axios
      .get("http://localhost:3000/chat/collect1")
      .then(res => {
        this.peopleinf = res.data.data;
        // console.log(res.data.data.length)
        console.log(this.peopleinf);
        console.log(res.data.data)
      })
      .catch(err => {
        console.log("错误信息：", err);
      });
  },
  methods: {
    getcollectonepic(collectpic) {
      return require("../assets/images/" + collectpic);
    }
  }
};
</script>
<style lang="css" scoped>
.collectidone {
  width: 60%;
  height: 100%;
}

#shoucang0 {
  margin-top:10px;
  width: 900px;
  height: 50px;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(45deg, rgb(160, 191, 124), rgb(255, 255, 255))
    fixed;
  line-height: 50px;
  font-size: 22px;
  padding-left: 40px;
}
#textbody {
  width: 900px;
  border: 1px solid #ccc;
  float: left;
}

#textimg {
  margin-left: 60px;
  margin-top: 30px;
  width: 200px;
  height: 250px;
  float: left;
  /* border:1px solid red; */
}
#textbody img {
  width: 200px;
  height: 200px;
  float: left;
  border-radius: 5px;
  position: relative;
}
#textimg img:hover{
  width: 200px;
  height: 200px;
  border:1px solid #ccc;
  box-shadow: 2px 2px 5px #ccc;
}
#texttext {
  float: left;
  width: 300px;
  height: 45px;
  line-height: 45px;
  padding-left: 10px;
}

#textbottom {
  width: 900px;
  float: left;
  text-align: center;
}

</style>